package SQLite3;

import java.io.BufferedReader;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class SQLRestore
{
  Database db;
  BufferedReader is;
  
  public SQLRestore(InputStream paramInputStream, Database paramDatabase)
  {
    this.is = new BufferedReader(new InputStreamReader(paramInputStream));
    this.db = paramDatabase;
  }
  
  public void restore()
    throws Exception
  {
    String str1 = null;
    String str3;
    try
    {
      String str2 = this.is.readLine();
      if (str2 == null)
      {
        if (str1 == null) {
          return;
        }
        throw new Exception("Incomplete SQL: " + str1);
      }
    }
    catch (EOFException localEOFException)
    {
      for (;;)
      {
        str3 = null;
      }
    }
    catch (IOException localIOException)
    {
      throw new Exception("I/O error");
    }
//    if (localIOException == null) {}
//    for (;;)
//    {
//      Object localObject = str3;
//      if (!Database.complete(str3)) {
//        break;
//      }
//      this.db.exec(str3, null);
//      localObject = null;
//      break;
//      str3 = (String)localObject + " " + str3;
//    }
  }
}
